'''
''' This method will add three records on the page.
'''
Public IsLoadDataCalled As Boolean = False
Public Overrides Sub LoadData()
' Call MyBase.LoadData()
MyBase.LoadData()
If Not Me.Page.IsPostBack() AndAlso Not IsLoadDataCalled Then
IsLoadDataCalled = True
Dim list As ArrayList
If (IsNothing(DataSource)) Then
list = New ArrayList()
Else
list = New ArrayList(Me.DataSource)
End If
Dim i As Integer
'This will insert rows at the end of the table control
For i = 0 To 2
list.Add(New ${${Table Name}RecordClassName})
Next i
'Add the code to insert rows at top of the table control
' For i = 0 To 2
' list.Insert(i, New ${${Table Name}RecordClassName})
' Next i
Me.DataSource = DirectCast(list.ToArray(GetType(${${Table Name}RecordClassName})), ${${Table Name}RecordClassName}())
End If
End Sub
|